<?php
// +----------------------------------------------------------------------
// | CoreThink [ Simple Efficient Excellent ]
// +----------------------------------------------------------------------
// | Copyright (c) 2014 http://www.corethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: jry <598821125@qq.com> <http://www.corethink.cn>
// +----------------------------------------------------------------------
namespace Common\Model;
use Think\Model;
/**
 * 文档类型
 * @author jry <598821125@qq.com>
 */
class LatestModel extends Model{
    /**
     * 自动验证规则
     * @author jry <598821125@qq.com>
     */
    protected $_validate = array(
        array('title', 'require', '標題不能为空', self::MUST_VALIDATE, 'regex', self::MODEL_BOTH),
        array('title', '', '標題已经存在', self::VALUE_VALIDATE, 'unique', self::MODEL_BOTH),
        array('content', 'require', '內容不能为空', self::MUST_VALIDATE, 'regex', self::MODEL_BOTH),
        array('contetn', '', '內容已经存在', self::VALUE_VALIDATE, 'unique', self::MODEL_BOTH),
    );

    /**
     * 自动完成规则
     * @author jry <598821125@qq.com>
     */
    protected $_auto = array(
        array('date', 'time', 3, 'function'),
    );
}
